<?php
/**
 * @Notes:【】
 * @User: zwc
 * @Date: 2022-05-31 0:48
 */

namespace App\Controller\Tasker\User;


use App\Controller\Task\BaseController;
use App\Middleware\AuthTokenMiddleware;
use App\Service\User\UserService;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\Middleware;
use Yj\Apidog\Annotation\ApiController;
use Yj\Apidog\Annotation\FormData;
use Yj\Apidog\Annotation\PostApi;

/**
 * @Notes:【】
 * @User: zwc
 * @Date: 2022-05-31 0:51
 * @Middleware(AuthTokenMiddleware::class)
 * @ApiController(prefix="tasker/user")
 */
class UserController extends BaseController
{
    /**
     * @Inject()
     * @var UserService
     */
    protected $userService;
    
    /**
     * @Notes:【】
     * @Date: 2022-05-31 0:52
     * @PostApi(path="info")
     */
    public function info()
    {
        $userInfo = $this->userService->getUserInfo($this->getUid());
        _SUCCESS(compact('userInfo'));
    }

    /**
     * @PostApi(path="task-statisc")
     * @FormData(key="test",message="我我我")
     */
    public function getTaskStatisc(){
        $data = $this->userService->getTaskStatic($this->getUid());
        _SUCCESS($data);
    }

}